package com.hairline.mapper;

import com.hairline.bean.User;
import com.hairline.bean.UserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface UserMapper {
    long countByExample(UserExample example);

    int deleteByExample(UserExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    List<User> selectByExample(UserExample example);

    User selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    Integer count();

    Integer selectIdByName(String username);

    @Update("update cskaoyanmall_user set last_login_time = now(), last_login_ip = #{ip} where id = #{id}")
    void updateLoginTime(Integer id, String ip);
}
